package main

import (
	"fmt"
	"github.com/spf13/pflag"
	"go-chat-room/connect"
	"go-chat-room/pkg/config"
)

var (
	cfg = pflag.StringP("config", "c", "", "config file path.")
	mod = pflag.StringP("mod", "m", "", "run service mod")
)

func main() {
	pflag.Parse()

	if err := config.Init(*cfg); err != nil {
		panic(err)
	}

	switch *mod {
	case "connect":
		server := connect.NewConnect()
		server.Run()
		break
	default:
		panic(fmt.Sprintf("mod not found: %s", *mod))
	}
}
